import VueRouter from 'vue-router'

import Haier from '@/page/haier/Haier'
import HaierHome from '@/page/haier/Home'
import Details from '@/page/haier/Details'
import Prolist from '@/page/haier/Commodity.vue'
import Shopping from '@/page/haier/Shopping.vue'


import Register from '@/page/Register'
import Login from '@/page/Login.vue'

import Profile from '@/page/Profile.vue'
import Root from '@/page/Home.vue'


const routes = [
    {
        path: '/',
        component: Root,
        children: [
        ]
    },
    {
        path: '/haier',
        component: Haier,
        children: [
            {
                path: '/',
                component: HaierHome,
            },
            {
                path: 'details',
                name: 'details',
                component: Details
            },
            {
                path: 'commodity',
                component: Prolist
            },
            {
                path: 'shoppingcar',
                component: Shopping
            },
            {
                path: 'profile',
                component: Profile
            }
        ]
    },
    {
        path: '/login',
        component: Login
    },
    {
        path: '/register',
        component: Register
    }
]



export default {
    install(Vue) {
        Vue.use(VueRouter)
    },
    create() {
        return new VueRouter({
            routes
        })
    }
}